package xueqiu

import (
	"gitee.com/gcom/stockdock/core/support"
	"github.com/jinzhu/gorm"
)

type StockQuoteEntity struct {
	support.SimpleEntity
	*StockQuote
}

func (StockQuoteEntity) TableName() string {
	return "stock_quote_xq"
}

type DailyQuoteHistEntity struct {
	support.SimpleEntity
	*DailyQuoteHist
}

func (DailyQuoteHistEntity) TableName() string {
	return "stock_hist_xq"
}

func UpdateStockQuote(db *gorm.DB, entities []*StockQuoteEntity) (int64, error) {
	return support.BatchInsertOrUpdate(db, entities, true)
}

func UpdateStockQuoteHist(db *gorm.DB, entities []*DailyQuoteHistEntity) (int64, error) {
	return support.BatchInsertOrUpdate(db, entities, true)
}
